/**

   dc.h
   ====

   Datacenter header

**/


#ifndef DC_H
#define DC_H


/**

   Includes
   --------

   - stdint.h   : uintX_t
   - chunksrv.h : chunkservers
   - heap.h     : heaps
   - dc.h       : self header

**/


#include <stdint.h>
#include "chunksrv.h"
#include "heap.h"


/**

   Structure: struct dc
   --------------------

   Members are:
   - id   : dc id
   - heap : chunkservers heap
   - prev : previous dc in linked list
   - next : next dc in linked list

**/


struct dc
{
  uint64_t id;
  struct heap* heap;
  struct dc* prev;
  struct dc* next;
};



/**

   Prototypes
   ----------

**/


struct dc* dc_create(uint64_t, unsigned int);
int dc_delete(struct dc*);
int dc_insert(struct dc*, struct chunksrv*);
int dc_remove(struct dc*, struct chunksrv*);
struct chunksrv* dc_extract(struct dc*);
int dc_compare(struct dc*, struct dc*);

#endif
